package com.lovo.lesson;

import java.util.HashSet;
import java.util.Iterator;

public class Test04 {
    public static void main(String[] args) {
        HashSet hashSet = new HashSet();
        hashSet.add(100);
        hashSet.add("hello set");
        hashSet.add(true);
        hashSet.add(new Student("小强",20,"男"));
        hashSet.add("hello set");
        hashSet.add(new Student("小强",21,"男"));

        Iterator it = hashSet.iterator();
        while(it.hasNext()){
            System.out.println(it.next());
        }

        for(Object obj : hashSet){
            System.out.println(obj);
        }
    }
}
